<?php if (count($this->paginator)): ?>
<?php foreach ($this->paginator as $item): ?>

        <div class="entry">
            <h3><a href="<?php echo $this->entryUrl(array('user' => $item['author'], 'blog' => urlencode($item['title']), 'id'=> $item['id'])) ?>"><?php echo $this->escape($item['title']) ?></a></h3>
            <span class="postedby"> Posted by <?php echo $this->escape($item['author']) ?> on <?php echo $this->formatDate($item['date']) ?></span>
            <p><?php echo $this->teaser($item['body']) ?></p>
            <ul class="entry-menu">
                <li>
                    <span><a href="<?php echo $this->entryUrl(array('user' => $item['author'], 'blog' => urlencode($item['title']), 'id'=> $item['id'])) ?>">Read more</a></span>
                </li>
                <li>|</li>
                <li>
            <?php if (Application_Model_DbTable_Comments::getCounts($item['id']) > 0): ?>
                <span><a href="<?php echo $this->entryUrl(array('user' => $item['author'], 'blog' => urlencode($item['title']), 'id'=> $item['id'])) ?>"><?php echo Application_Model_DbTable_Comments::getCounts($item['id']) ?> Comments</a></span>
            <?php else: ?>
                    <span><a href="<?php echo $this->entryUrl(array('user' => $item['author'], 'blog' => urlencode($item['title']), 'id'=> $item['id'])) ?>">0 Comments</a></span>
            <?php endif; ?>
                </li>
            </ul>
            <hr />
        </div>
<?php endforeach; ?>
<?php echo $this->paginationControl($this->paginator, 'Elastic', '/partials/_paginatorPosts.phtml'); ?>
<?php else: ?>
<h3>Empty Blog</h3>
<?php endif; ?>
